package com.gitee.cirnochat.chatai.model.enums.aimodel;

import com.baomidou.mybatisplus.annotation.EnumValue;
import com.fasterxml.jackson.annotation.JsonValue;
import com.gitee.cirnochat.common.model.enums.BaseEnum;
import lombok.Getter;

/**
 * AI模型类型枚举类
 * @author FlanChan
 * @since 2025/5/15
 */
@Getter
public enum AIModelType implements BaseEnum<String> {
    DEEP_SEEK_R1("lke-deepseek-r1"),
    DEEP_SEEK_V3("lke-deepseek-v3"),
    DEEPDUCK_NORMAL("cs-normal"),
    ;

    /**
     * 模型分类名称
     */
    @EnumValue // 用于 MyBatis-Plus 映射数据库值
    @JsonValue // 用于 JSON 序列化
    private final String value;

    AIModelType(String value) {
        this.value = value;
    }

    public static AIModelType fromValue(String value) {
        for (AIModelType type : AIModelType.values()) {
            if (type.getValue().equals(value)) {
                return type;
            }
        }
        return null;
    }

}
